﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <input type="text" id="username" value="2" />
    <br />
    Click on submit button to call worker
    <button id="btnSubmit">Submit</button>
    <script type="text/javascript">
        var worker = new Worker("workerjs.js");
        worker.onmessage = function (event) {
            alert(event.data + " Home");
        };
        document.getElementById("btnSubmit").onclick = function () {
            worker.postMessage(document.getElementById("username").value);
        };
    </script>
</body>
</html>
